<template>
	<view class="contont" style="background-color: #F5F5F5;">
		<view class="infromid">
			<view style="height: 50%;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" >
					<text style="font-size: 15px;margin-left: 30rpx;">银行名称</text>
					<input type="text"  placeholder="请输入银行名称" v-model="codes"  style="font-size: 15px;width: 30%;margin-right: 15px;text-align: right;"/>
			</view>
			<view style="height: 50%;width: 100%; " class="cent" >
					<text style="font-size: 15px;margin-left: 30rpx;">银行账户</text>
					<input type="text"  placeholder="请输入银行账户"  v-model="coded"  style="font-size: 15px;width: 50%;margin-right: 15px;text-align: right;"/>
			</view>
		</view>
		<view class="infromid" style="height: 167px;">
			<view style="height: 33.3%;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" >
					<text style="font-size: 15px;margin-left: 30rpx;">持卡人姓名</text>
					<input type="text"  placeholder="请输入持卡人姓名" v-model="coding"  style="font-size: 15px;width: 40%;margin-right: 15px;text-align: right;"/>
			</view>
			<view style="height: 33.3%;width: 100%;border-bottom: 1px solid #F5F5F5; " class="cent" >
					<text style="font-size: 15px;margin-left: 30rpx;">账户类型</text>
					<text style="font-size: 15px;margin-right: 15px;color: #000000;">个人</text>
			</view>
			<view style="height: 33.3%;width: 100%; " class="cent" >
					<text style="font-size: 15px;margin-left: 30rpx;">借贷类型：</text>
					<text style="font-size: 15px;margin-right: 15px;color: #000000;">储蓄卡</text>
			</view>
		</view>
		<button @click="but">添加</button>
	</view>
</template>

<script>
	import {ajaxs} from '../../apis.js'
	export default {
		data() {
			return {
			codes:"",
			coded:"",
			coding:""
			}
		},
		onLoad() {
		
		},
		methods: {
			but(){
				var that=this
				if(this.codes==""&&this.coded==""&&this.coding==""){
					uni.showToast({
					    title: '请输入信息',
						icon:"none"
					})
				}else{
					uni.showLoading({
						title: '认证中请稍等'
					});
					ajaxs({
						url:"/v1/appdriver/bind/bankCard",
						method:"post",
						data:{
							card_no:that.coded,
							bankAccountNumber:that.codes,
							bankUserName:that.coding
						},
						success(res){
							if(res.data.status=="OK"){
								uni.hideLoading();
							uni.reLaunch({
								url:"../Receipt/Receipt"
							})
							}else{	
								uni.hideLoading();
								uni.showToast({
								    title: '认证失败请检查信息',
									icon:"none"
								})
							}
						}
					})
				}
			}
		}
	}
</script>

<style>
	page{
		height: 100%;
	}
.infromid{
	width:355px;
	height:111px;
	background:rgba(255,255,255,1);
	border-radius:8px;
	margin-top: 10px;
}

button{
	width:355px;
	height:44px;
	background:rgba(4,42,88,1);
	border-radius:8px;
	color: #FFFFFF;
	margin-top: 231px;
}
</style>
